/**
 * 1. data 数据
 * 2. message 提示信息
 * 3. 状态  成功0  失败-1
 */
class base {
  constructor(data, message) {
     if (typeof data === 'string') {
       this.message = data
       data = null;
       message = null;
     }
     if (data) {
       this.data = data
     }
     if (message) {
       this.message = message
     }
  }
}

class SuccessModel extends base {
  constructor(data, message) {
    super(data, message)
    this.errno = 0
  }
}

class FailModel extends base {
  constructor(data, message) {
    super(data, message)
    this.errno = -1
  }
}

module.exports = {
  SuccessModel,
  FailModel
}